﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SJTU.SE.RoughSet.Lib.Data;
using SJTU.SE.RoughSet.Lib.IO;
using NUnit.Framework;


namespace SJTU.SE.RoughSet.Test.Data
{
    [TestFixture]
    public class DecisionTableTest
    {
        DecisionTable testDecisionTable = new DecisionTable(new DecisionTableFileInitializer(".\\TestData\\zoo.txt"));
      
        [Test]
        public void DecisionTable_can_get_value_by_row_and_column()
        {
            Assert.AreEqual(1, testDecisionTable[0, 0]);
            Assert.AreEqual(0, testDecisionTable[1, 2]);
        }

        [Test]
        public void DecisionTable_can_get_right_element_count()
        {
            Assert.AreEqual(101, testDecisionTable.ElementCount, "DecisionTable should return right element count");

        }

        [Test]
        public void DecisionTable_can_get_right_sympton_count()
        {
            Assert.AreEqual(16, testDecisionTable.SymptonCount, "DecisionTable should return right symptom count");

        }

        [Test]
        public void DecisionTable_have_right_decision_count()
        {
            Assert.AreEqual(testDecisionTable.ElementCount, testDecisionTable.Decisions.Length);
        }

        [Test]
        public void DecisionTable_should_have_right_vale()
        {
            Assert.AreEqual(1, testDecisionTable.Decisions[0]);
            Assert.AreEqual(2, testDecisionTable.Decisions[100]);
        }
    }
}
